package com.lune.job.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lune.job.mapper.CertificateMapper;
import com.lune.job.pojo.Certificate;
import com.lune.job.pojo.ResPageBean;
import com.lune.job.service.ICertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Caiyilin
 * @since 2022-03-06
 */
@Service
public class CertificateServiceImpl extends ServiceImpl<CertificateMapper, Certificate> implements ICertificateService {

    @Autowired
    private CertificateMapper certificateMapper;

    /**
     * 分页查询证书
     * @param currentPage
     * @param size
     * @param certificate
     * @return
     */
    @Override
    public IPage<Certificate> queryPage(Integer currentPage, Integer size, Certificate certificate) {
        Page<Certificate> page = new Page<>(currentPage, size);
        IPage<Certificate> articleIPage = certificateMapper.queryPage(page,certificate);
        return articleIPage;
    }

    /**
     * 条件查询证书
     * @param certificate
     * @return
     */
    @Override
    public List<Certificate> queryByCon(Certificate certificate) {
        return certificateMapper.queryByCon(certificate);
    }
}
